function pass() {    //游戏成功
    const div = document.getElementsByClassName('nav')[0]
    const win = document.createElement('p');
    const curTime = new Date().getTime();
    const diff = curTime - div.startTime;
    const second = Math.floor(diff / (1000)) % 60;
    const minute = Math.floor(diff / (60000));
    win.innerText = `恭喜你！一共用时${minute}分${second}秒！`;
    win.id = 'over';
    div.appendChild(win);
    over();
}
function gameover(obj) {    //游戏结束
    const div = document.getElementsByClassName('nav')[0]
    const lose = document.createElement('p');
    lose.id = 'over';
    lose.innerText = '哦豁，踩到地雷啦';
    div.appendChild(lose);

    const row = MINENUM, col = MINENUM;
    for (let i = 1; i <= row; i++) {
        for (let j = 1; j <= col; j++) {
            let temp = document.getElementById(i * 100 + j);
            if (temp.mine) {
                temp.className = 'mine click over iconfont icon-zhadan';
                //console.log('出现地雷啦')
            }
        }
    }

    obj.className = 'mine click boom iconfont icon-zhadan';
    over();
}
function over() {    //设置地雷按钮不可点击
    let btn = document.getElementsByClassName('flag');
    for (let i = 0; i < btn.length; i++) {
        btn[i].disabled = true;
    }
    btn = document.getElementsByClassName('init');
    for (let i = 0; i < btn.length; i++) {
        btn[i].disabled = true;
    }
}